package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallActivity;
import com.appkubes.mall.core.po.MallActivityExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallActivityMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallActivitySqlProvider.class, method="countByExample")
    long countByExample(MallActivityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallActivitySqlProvider.class, method="deleteByExample")
    int deleteByExample(MallActivityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_activity",
        "where activity_key = #{activityKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String activityKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_activity (activity_key, app_key, ",
        "activity_name, activity_agreement, ",
        "reward_descrition, description, ",
        "`status`, start_time, ",
        "end_time)",
        "values (#{activityKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{activityName,jdbcType=VARCHAR}, #{activityAgreement,jdbcType=VARCHAR}, ",
        "#{rewardDescrition,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, ",
        "#{endTime,jdbcType=TIMESTAMP})"
    })
    int insert(MallActivity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallActivitySqlProvider.class, method="insertSelective")
    int insertSelective(MallActivity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallActivitySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="activity_key", property="activityKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="activity_name", property="activityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="activity_agreement", property="activityAgreement", jdbcType=JdbcType.VARCHAR),
        @Result(column="reward_descrition", property="rewardDescrition", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<MallActivity> selectByExampleWithRowbounds(MallActivityExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallActivitySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="activity_key", property="activityKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="activity_name", property="activityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="activity_agreement", property="activityAgreement", jdbcType=JdbcType.VARCHAR),
        @Result(column="reward_descrition", property="rewardDescrition", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<MallActivity> selectByExample(MallActivityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "activity_key, app_key, activity_name, activity_agreement, reward_descrition, ",
        "description, `status`, start_time, end_time",
        "from mall_activity",
        "where activity_key = #{activityKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="activity_key", property="activityKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="activity_name", property="activityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="activity_agreement", property="activityAgreement", jdbcType=JdbcType.VARCHAR),
        @Result(column="reward_descrition", property="rewardDescrition", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP)
    })
    MallActivity selectByPrimaryKey(String activityKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallActivitySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallActivity record, @Param("example") MallActivityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallActivitySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallActivity record, @Param("example") MallActivityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallActivitySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallActivity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_activity
     *
     * @mbg.generated
     */
    @Update({
        "update mall_activity",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "activity_name = #{activityName,jdbcType=VARCHAR},",
          "activity_agreement = #{activityAgreement,jdbcType=VARCHAR},",
          "reward_descrition = #{rewardDescrition,jdbcType=VARCHAR},",
          "description = #{description,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=VARCHAR},",
          "start_time = #{startTime,jdbcType=TIMESTAMP},",
          "end_time = #{endTime,jdbcType=TIMESTAMP}",
        "where activity_key = #{activityKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallActivity record);
}